import {createBrowserRouter} from "react-router-dom";
import App from "../App.jsx";
import Info from "../page/Info.jsx";
import Lodin from "../page/Lodin.jsx";
export default createBrowserRouter([
    {
        path: "/",
        element: <App/>
    },
    {
        path: "/user",
        lazy:async ()=>{
            let Page =  await import("../page/User.jsx")
            Page = Page.default
            return  {
                element: <Page />
            }
        }
    },

    {
        path: "/info",
        element:<Info />,
        loader({request}) {
            return new Promise((resolve, reject) => {
                setTimeout(() => { //模拟请求延迟
                    resolve([
                        {
                            id: 1, name: '测试'
                        }
                    ])
                }, 500)
            })
        }
    },
])